<template>
      <wraper>
        <host style="flex: 1"  :page="index">
          <home-index  class="main" @page="set_page"></home-index>
          <trade-index  class="main" @page="set_page"></trade-index>
          <wallet-index  class="main" @page="set_page"></wallet-index>
          <find-index  class="main" @page="set_page"></find-index>
          <my-index  class="main" @page="set_page"></my-index>
        </host>
      </wraper>
</template>

<script>
import TradeIndex from '../trade/index.vue'
import WalletIndex from '../wallet/index.vue'
import FindIndex from '../find/index.vue'
import MyIndex from '../my/index.vue'
import HomeIndex from '../home/home.vue'
var updater=weex.requireModule('updater')
var env=weex.requireModule('env')
export default {
  name: 'index',
  data () {
    return {
      index:0,
    }
  },
  components: {TradeIndex,WalletIndex,FindIndex,MyIndex,HomeIndex},
  computed: {},
  watch: {},
  created () {
    // this.check_updater()
    var page=weex.requireModule("page")
    page.doubleBack()
    page.setBackKeyCallback(()=>{
        page.enableBackKey(true);
    })
  },
  mounted () {},
  methods: {
   set_page(index){
     this.index = index
   },
   check_updater(){
          //整包检测
      updater.doCheck({
        appid:'com.songli.park',
        url:'http://140.143.247.204:8082/app/index/checkupdate?appType=1&appNumber=0', //(这里记得改成自己的接口地址)
        theme:'#808080',
        failtoast:true,
        showprogress:true
      })
   }
  }
}
</script>
<style  scoped>
 .main{
   width: 750px;
   position: absolute;
   top: 0;
   left: 0;
   bottom: 0;
 }
</style>
